const BASEURL = "http://localhost:4001"

export default function fetchData({url, method = "GET", data = {}}) {
	return new Promise((resolve, reject) => {
		uni.request({
			url: BASEURL + url,
			method,
			data,
			success(res) {
				resolve(res)
			},
			fail(error) {
				reject(error)
			}
		})
	})
}
